<include file="Public/header1" title="账户列表"   />
<link href="__PUBLIC__/css/owner.css" rel="stylesheet">
<div class="main">
    <div class="wrap">
        <include file="Public/sidebar" />

        <div class="content">
            <div class="nav">
                <a class="add" href="{:U('addReporter')}"><i></i><span>添加用户</span></a>
                <div class="search">
                    <form action="">
                        <input type="text" name="username" class="search-inner">
                        <div class="search-icon">
                            <button type="submit"></button>
                        </div>
                    </form>
                </div>
            </div>
            <table class="list">
                <thead>
                <tr>
                    <th class="checkAll"><input type="checkbox" id="checkAll"/></th>
                    <th>真实姓名</th>
                    <th>手机号</th>
                    <th>所属媒体</th>
                    <th>最后登录时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="userList" id="user">
                <tr>
                    <td class="checkAll"><input type="checkbox"/></td>
                    <td>{$user.realname}</td>
                    <td>{$user.mobile}</td>
                    <td>{$user.channelname}</td>
                    <td><?php if($user['lastlogintime']!=0){echo date("Y-m-d",$user['lastlogintime']);}else{echo "";} ?></td>
                    <td>
                        <input type="checkbox" name="item" id="item{$user.uid}" class="item statusItem" value="{$user.uid}" <?php if($user['userstatus'] == 1){ ?>checked <?php } ?> />
                        <label class="ctrl" for="item{$user.uid}">
                            <i></i>
                        </label>
                    </td>
                    <td>
                        <a href="{:U('editReporter')}?uid={$user.uid}" class="modify">修改</a><!--|<a href="javascript:void(0)" class="del reporterDel" data-uid="{$user.uid}">删除</a>-->
                    </td>
                </tr>
                </volist>
                </tbody>
            </table>
            <div class="controls">
                <div class="pagers">
                    {$page}
                </div>

            </div>
        </div>

        <div class="clr"></div>
    </div>
</div>
<script>
    $(function(){
        $("#checkAll").click(function(){
            if($(this).is(":checked")){
                $(".checkAll").find('input').prop("checked",true);
            }else{
                $(".checkAll").find('input').prop("checked",false);
            }
        });
        $(".statusItem").click(function (e) {
            e.preventDefault();
            var _this=this;
            $.get("{:U('setReporterStatus')}",{uid:$(_this).val()},function(data){
                if(data.status){
                    $(_this).prop('checked',data.info);
                }
            })
        })

        $(".reporterDel").click(function(){
            if(confirm('是否确认删除此用户？')){
                var _this=this;
                $.get("{:U('ajaxdeluer')}",{uid:$(_this).data('uid')},function(data){
                    if(data){
                        $(_this).parents('tr').remove();
                    }
                })
            }
        })

    })
</script>
<include file="Public/footer" />